home *** CD-ROM | disk | FTP | other *** search
- property pkListSprite, pCloseBoxObj, pScrollbarObj
-
- on new me
- pkListSprite = 7
- pCloseBoxObj = new(script("close box button"), "close box", "Global", 3, the loc of sprite 3)
- Inscope(pCloseBoxObj)
- displayTxt = EMPTY
- DocsDisplayed = 0
- repeat with win in the windowList
- if win.name <> "WinList" then
- put win.name & RETURN after displayTxt
- if (win.name <> "Search") and (win.name <> "Search Results") then
- DocsDisplayed = 1
- end if
- end if
- end repeat
- set the textHeight of field "window list field" to 14
- if DocsDisplayed = 1 then
- put "------------------------------------------------------" & RETURN after displayTxt
- put "Close all documents" after displayTxt
- end if
- put displayTxt into field "window list field"
- bedChannel = 13
- textChannel = 7
- hiliteChannel = 5
- pScrollbarObj = new(script("text scroll bar"), bedChannel, textChannel, hiliteChannel)
- Inscope(pScrollbarObj)
- return me
- end
-
- on dispose me
- end
-
- on getCloseBoxObj me
- return pCloseBoxObj
- end
-
- on getScrollbarObj me
- return pScrollbarObj
- end
-
- on clickList me
- clickedLine = the mouseLine
- if (clickedLine <= 0) or (stripPunct(line clickedLine of field "window list field") = EMPTY) then
- setSelection(pScrollbarObj, 0)
- else
- setSelection(pScrollbarObj, clickedLine)
- openSelection(me)
- end if
- end
-
- on openSelection me
- global gForgetList
- selectionName = line getSelection(pScrollbarObj) of field "window list field"
- if selectionName = "Close all documents" then
- closeAllDocuments(me)
- else
- window("WinList").modal = 0
- moveToFront(window(selectionName))
- end if
- append(gForgetList, window("WinList"))
- end
-
- on closeAllDocuments me
- windowListSnapShot = duplicate(the windowList)
- repeat with winRef in windowListSnapShot
- windowName = winRef.name
- if (windowName <> "Search") and (windowName <> "Search Results") and (windowName <> "WinList") and (windowName <> "Graph Wizard") then
- tell window(windowName)
- CloseMIAW()
- end tell
- end if
- end repeat
- end
-